<?php
namespace app\api\controller\v1;

use app\api\controller\Base;
use app\api\validate\IdMPot;
use app\lib\exception\MissEx;
use app\api\model\Banner as BannerModel;
/** 
* Document
*/
class Banner extends Base {
    
    public function getBanner($id){
        # 1.参数校验层
        (new IdMPot())->goCheck();
        # 2.查询数据
        $res = BannerModel::getBannerById($id);

        if(empty($res)) throw new MissEx('请求的banner不存在',30001);
        
        return $this->data($res);
    }
}